*** Another do file for the aggregate state Data ***

clear
use "C:\Users\dmac9\Dropbox\R&R SSQ Unions and Inequality\US State Data.dta"

*All unions*
reg pro_welfare c.top1##c.union pid ideo nonwhite per_capita_income unemployment  policyeconlib_est i.year_dvs i.state_fips, cluster(state_fips)
outreg2 using state_welfare.tex, dec(3) replace

margins, dydx(top1) at(union=(2(1)38))
marginsplot, yline(0)

*Private sector vs. Private Sector*
reg pro_welfare c.top1##c.private_union pid ideo nonwhite per_capita_income unemployment  policyeconlib_est i.year_dvs i.state_fips, cluster(state_fips)
outreg2 using state_welfare_sector.tex, dec(3) replace
reg pro_welfare c.top1##c.public_union pid ideo nonwhite per_capita_income unemployment  policyeconlib_est i.year_dvs i.state_fips, cluster(state_fips)
outreg2 using state_welfare_sector.tex, dec(3) append

*South vs. Non-South*
reg pro_welfare c.top1##c.union pid ideo nonwhite per_capita_income unemployment  policyeconlib_est i.year_dvs if South==1, cluster(state_fips)
outreg2 using state_welfare_south.tex, dec(3) replace
reg pro_welfare c.top1##c.union pid ideo nonwhite per_capita_income unemployment  policyeconlib_est i.year_dvs if South==0, cluster(state_fips)
outreg2 using state_welfare_south.tex, dec(3) append

*Using Frank Gini Coefficient*
reg pro_welfare c.gini##c.union pid ideo nonwhite per_capita_income unemployment  policyeconlib_est i.year_dvs i.state_fips, cluster(state_fips)
outreg2 using gini_pre.tex, dec(3) replace

*Using Bucci post-transfer Gini*
reg pro_welfare c.postgini##c.union pid ideo nonwhite per_capita_income unemployment  policyeconlib_est i.year_dvs i.state_fips, cluster(state_fips)
outreg2 using gini_post.tex, dec(3) replace



